from helpers.director.shortcut import model_to_name, model_full_permit, add_permits, model_read_permit
from .models import *

permits=[
    
    ('ProdRecord',model_read_permit(ProdRecord),model_to_name(ProdRecord),'model'),
    ('ProdRecord.edit', model_full_permit(ProdRecord), model_to_name(ProdRecord), 'model' ),
    ('FailSource',model_read_permit(FailSource),model_to_name(FailSource),'model'),
    ('FailSource.edit', model_full_permit(FailSource), model_to_name(FailSource), 'model' ),
    
    ('FailKind',model_read_permit(FailKind),model_to_name(FailKind),'model'),
    ('FailKind.edit', model_full_permit(FailKind), model_to_name(FailKind), 'model' ),
    ('ProcessingScheme',model_read_permit(ProcessingScheme),model_to_name(ProcessingScheme),'model'),
    ('ProcessingScheme.edit', model_full_permit(ProcessingScheme), model_to_name(ProcessingScheme), 'model' ), 
    
    ('ProdModel',model_read_permit(ProdModel),model_to_name(ProdModel),'model'),
    ('ProdModel.edit', model_full_permit(ProdModel), model_to_name(ProdModel), 'model' ), 
    
    ('QualityEvent',model_read_permit(QualityEvent),model_to_name(QualityEvent),'model'),
    ('QualityEvent.edit', model_full_permit(QualityEvent), model_to_name(QualityEvent), 'model' ), 
    
    ('DepartMent',model_read_permit(DepartMent),model_to_name(DepartMent),'model'),
    ('DepartMent.edit', model_full_permit(DepartMent), model_to_name(DepartMent), 'model' ),    
    
    ('FailAbstract',model_read_permit(FailAbstract),model_to_name(FailAbstract),'model'),
    ('FailAbstract.edit', model_full_permit(FailAbstract), model_to_name(FailAbstract), 'model' ),       
    
    ('Userinfo',model_read_permit(Userinfo),model_to_name(Userinfo),'model'),
    ('Userinfo.edit', model_full_permit(Userinfo), model_to_name(Userinfo), 'model' ),      
    
    ('user-read',';'.join(['Userinfo','User.read']),'','set'), 
    ('user-edit',';'.join(['Userinfo.edit','User.write']),'','set'),      
    
    ]
add_permits(permits)